#!/usr/bin/python2
# -*- coding: utf8 -*-
from PyQt4 import QtCore, QtGui, Qt
import sys

class Log(QtCore.QObject):
    level = 7
    DEBUG = 7
    LOG = 5
    WARNING = 3
    ERROR = 1

    def __init__(self, parent=None):
        QtCore.QObject.__init__(self, parent)

    def _log_print(self, level, msg):
        if(level <= self.level):
            print msg

    def debug(self, msg):
        self._log_print(self.DEBUG, msg)

    def info(self, msg):
        self._log_print(self.LOG, msg)

    def warning(self, msg):
        self._log_print(self.WARNING, msg)

    def error(self, msg):
        self._log_print(self.ERROR, msg)

log = Log()
